import Vue from 'vue'
import VueRouter from 'vue-router'
import MainView from '@/views/MainView.vue'
import Screen from '@/views/Screen.vue'
import Management from '@/views/Management.vue'
import SingleDevice from '@/views/Device.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Health',
    component: MainView,
    children: [
      { path: '/', component: Screen },
      { path: '/management', component: Management },
      { name: '/single_device', path: '/single_device', component: SingleDevice }
    ]
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
